package exam.AndroidFirst;


import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ScrollView;
import android.widget.TextView;
import android.widget.Toast;

public class Tab2Content extends Activity{
	String url;
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab2_content);

        String board_seq=getIntent().getStringExtra("board_seq");
        String handle=getIntent().getStringExtra("handle");
        String subject=getIntent().getStringExtra("subject");
        url="http://cm.sejong.ac.kr/servlet/kr.co.k2web.jwizard.contents.board.boardUser.servlet.userMainServlet?client_id=board&handle="+handle+"&command=view&curPage=1&board_seq="+board_seq+"&b_type=01";
        String result=GetNoticeContent.getNoticeContent(url);
        
        ((Button)findViewById(R.id.goUrlButton)).setOnClickListener(new Button.OnClickListener(){
        	public void onClick(View v){
                Intent i=new Intent(Tab2Content.this,Tab2ContentWeb.class);
        		i.putExtra("url",url);
        		startActivity(i);
        	}
        });
        ((TextView)findViewById(R.id.txt)).setText(Html.fromHtml(result));
        ((TextView)findViewById(R.id.contentSubject)).setText(subject);
        //Toast.makeText(this, "url="+url+"result="+result, Toast.LENGTH_LONG).show();
	}
}
